package com.t3.tuio
{
	import com.t3.display.StageObject;
	
	public class TUIOPoint extends StageObject 
	{
		protected var _s_id:uint;
		protected var _x:Number;
		protected var _xStage:Number;
		protected var _y:Number;
		protected var _yStage:Number;
		protected var _dx:Number;
		protected var _dy:Number;
		
		public function TUIOPoint( event:TUIOEvent ):void
		{
			this._s_id = event.s_id;
		}
		
		public function update( event:TUIOEvent, ignoreEvent:Boolean = false ):void
		{
			if( ignoreEvent || event != null && event.s_id == this.s_id && ( event.x != _x || event.y != _y ) )
			{
				this._x = event.x;
				this._xStage = event.xStage;
				this._y = event.y;
				this._yStage = event.yStage;
				this._dx = event.dx;
				this._dy = event.dy;
			}
		}
		
		public function get s_id():uint
		{
			return _s_id;
		}
		
		public function get xpos():Number
		{
			return _x;
		}
		
		public function get ypos():Number
		{
			return _y;
		}
		
		public function get dx():Number
		{
			return _dx;
		}
		
		public function get dy():Number
		{
			return _dy;
		}
		
		public function get xStage():Number
		{
			return _xStage;
		}
		
		public function get yStage():Number
		{
			return _yStage;
		}
	}
}